﻿using Microsoft.TeamFoundation.WorkItemTracking.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SearchForWorkitemsChanges.ExternalActions.ExportXmlComponents
{
    /// <summary>
    /// Class used by Xml Serialization and Reporting to access and control workitems properties.
    /// </summary>
    /// <remarks>
    /// <list type="bullet">
    ///     <item>
    ///         <term>Reporting : this class allow to access Nested properties (reportviewer could not do that natively)</term>
    ///     </item>
    ///     <item>
    ///         <term>Xml Exporting : this class allow to limit the serialization levels</term>
    ///     </item>
    /// </list>
    /// </remarks>
    public class SerializedFacadeWorkItem
    {
        public SerializedFacadeWorkItem()
        {
 
        }

        private readonly WorkItem currentSrc;
        internal SerializedFacadeWorkItem(WorkItem itemSource)
        {
            this.currentSrc = itemSource;
        }

        [System.Xml.Serialization.XmlAttribute()]
        public string Id { get { return Convert.ToString(this.currentSrc.Id); } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public string Type { get { return this.currentSrc.Type.Name; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public string State { get { return this.currentSrc.State; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public string Title { get { return this.currentSrc.Title; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlElement(ElementName="Description")]
        public string Description { get { return this.currentSrc.Description; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public DateTime CreatedDate { get { return this.currentSrc.CreatedDate; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public string AreaPath { get { return this.currentSrc.AreaPath; } set { throw new NotImplementedException(); } }

        [System.Xml.Serialization.XmlAttribute()]
        public string IterationPath { get { return this.currentSrc.IterationPath; } set { throw new NotImplementedException(); } }

    }
}
